/*
 * Copyright 2003-2005 (c) Live Media Pty Ltd. <argot@einet.com.au> 
 *
 * This software is licensed under the Argot Public License 
 * which may be found in the file LICENSE distributed 
 * with this software.
 *
 * More information about this license can be found at
 * http://www.einet.com.au/License
 * 
 * The Developer of this software is Live Media Pty Ltd,
 * PO Box 4591, Melbourne 3001, Australia.  The license is subject 
 * to the law of Victoria, Australia, and subject to exclusive 
 * jurisdiction of the Victorian courts.
 */

#include "Types.h"

#include "TypeElement.h"


int type_element_bind( type_element * element, type_definition * definition )
{
	element->definition = definition;
	return TYPE_OK;
}

void type_element_init( type_element * element, typeBind bind )
{
	element->bind = bind;
}

type_library * type_element_get_library( type_element * element )
{
	return element->definition->library;
}

/* get the top level element for this definition. */
type_element * type_element_get_type_definition( type_element * element )
{
	return element->definition->structure;
}

type_name * type_element_name( type_element * element )
{
	return element->definition->name;
}

int type_element_get_type_id( type_element * element )
{
	return element->definition->id;
}

/* return the static ids for the meta types. 
int type_element_type( type_element * element )
{
	return element->type;
}
*/

int type_element_equal( type_element * element, type_name * name )
{
	return element->definition->name->hash == name->hash;
}

